package com.xh.bussiness.permission.task;

import com.xh.bussiness.permission.service.IUserOnlineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class CheckUserOnlineTask {

    @Autowired
    private IUserOnlineService userOnlineService;

    /**
     * 定时更新用户在线状态
     */
    @Scheduled(cron = "0 0/5 * * * ?")
    public void runCheckUserOnlineTask() {
        // 更新用户在线状态
        userOnlineService.updateOnlineStates();
    }
}
